<!--{template "topic_header"}-->

<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][journals][header]}-->
<!--{eval SetADV('journals','header');}-->
<!--{/if}-->

<div class="main">    
  <div class="mainWrap">
    <div class="listBox">
    <div class="eventInfo">
    <div class="e_list_title">{$rs['title']}<!--{if $from['name']}-->(来自<a href="{$from['url']}" target='_blank'>$from['name']</a>)<!--{/if}--></div>
	<div class="e_list_box" style="margin-bottom:30px;">
	  <div class="left_user_info">
	    <div class="avatar_left">
	      <a target="_blank" href="{$rs[image]}">
	        <img src="{$rs[image]}" width="150"></img>
	      </a>
	    </div>
	    <div class="avatar2_info event_d avatar2_info_2" style="margin-right:10px; border-right:1px dashed #ccc;">
	      <p class="left_t2">
	     发表时间：{$rs['create_time']}
	      </p>
	      <p class="left_t2">
	        地点：{$rs['address']}
	      </p>
	      <p class="left_t2">
	        顶：{$rs[up]}&nbsp;&nbsp;&nbsp;踩：{$rs[down]}
	      </p>
	      <p class="left_t2">
	        点击率:{$rs[click]}
	      </p>
	      <p class="left_t2">
	        发起人：<a href="index.php?mod=$rs[username]"  target="_blank">{$rs[nickname]}</a><a href="index.php?mod=journals&code=myjournals&uid=$rs['uid']" target="_blank">(查看他的游记)</a>
	      </p>
	      
	    </div>
        
        <div class="event_eidt_box">
          	<a href="javascript:void(0);" onclick="share();return false;" class="efx">分享</a>
	        <!--{if !$rs[store]}-->
	        <a href="javascript:void(0);" onclick="store('store');return false;" class="esc">收藏</a>
	        <!--{else}-->
	        <a href="javascript:void(0);" onclick="store('cancle');return false;" class="esc">取消收藏</a>
	        <!--{/if}-->
	        <a href="#" class="{if $rs[evaluate]==null}up{else}no_pic{/if}">顶({$rs[up]})</a>
	        <a href="#" class="{if $rs[evaluate]==null}down{else}no_pic{/if}">踩({$rs[down]})</a>
            <!--{if MEMBER_ID == $rs[postman]}-->
	        <a href="index.php?mod=journals&code=editjournals&id=$rs[id]" class="exg">修改游记</a>
	        <a href="index.php?mod=journals&code=del&id=$rs[id]" onclick="return confirm('你确实要删除吗?不可恢复');" class="edel">删除游记</a>
	      <!--{/if}-->
         </div>
         
	  </div>
	</div>
	
	<div class="e_idS" style="overflow:visible">
	  <div class="e_idSpTitle">
	    <b>游记</b>
	  </div>
	  <div class="e_intro">
	    {$rs[content]}
	  </div>
	</div>
    </div>
	<div class="topic_new_add">
		<script language="javascript">
			__APPITEM__ = 'journals';
			__APPITEM_ID__ = {$rs[id]};
		</script>
	  <!--{template "topic_publish"}-->  
	  </div>
	<div id="listTopicArea" style="margin:5px 0; width:650px; float:left">
		{template "topic_list_ajax"}
	  </div>
	  <div id="share"></div>
	  <div id="need_info"></div>
    </div>

	<script type="text/javascript">
	$(function(){
		function evalRs(rs,eval){
			var up={$rs[up]},down={$rs[down]};
			++up;++down;
			if(rs=='true'){
				show_message('评价成功!金币 +1');
				if(eval=='up'){
					$(".up").html('顶 ('+up+')');
				}else{
					$(".down").html('踩('+down+')');
				}
				$(".up,.down").addClass("no_pic").removeClass("up").removeClass("down");
			}else{
				show_message(rs);
			}
		}
		$(".up").click(function(){
			$.post('ajax.php?mod=journals&code=evaluate',{evaluate:'up',id:{$rs[id]}},function(rs){
				evalRs(rs,'up');
			});
			return false;
		});
		$(".down").click(function(){
			$.post('ajax.php?mod=journals&code=evaluate',{evaluate:'down',id:{$rs[id]}},function(rs){
				evalRs(rs,'down');
			});
			return false;
		});
	});
	function listTopic() {
		var id = document.getElementById('hid_id').value;
		var myAjax = $.post(
			"ajax.php?mod=app&code=list_journals&item_id="+id,
			function (d) {
				$("#listTopicArea").html(d);
			}
		); 
	}
	
	function share(t){
		var check_uid = $('#check_PublishBox_uid').val();
		var uid ='undefined'==typeof(check_uid)?'0':check_uid;	
		if(uid < 1){
			ShowLoginDialog();
			return false;
		}
		var handle_key = "share";
		$.post(
				"ajax.php?mod=journals&code=publish_share&id=$id",
				function(d){
					showDialog(handle_key, 'local', '分享', {"html":d}, 500);
					$('#topic_simple_close_btn').click(
						function() {
							if(t){
								location.reload();
							}else{
								closeDialog(handle_key);
							}
						}
					);
					$('#topic_simple_share_btn').click(
						function () {
							var options = {
									response:function(){
										closeDialog(handle_key);
									}
								}
							publishSimpleTopic($('#topic_simple_content').val(), 'web', $("#topic_simple_item_id").val(),options);
							MessageBox('notice', '分享成功');
						}
					);
				}
		);
	}

	function simpleTalk(){
		var handle_key = "simpletalk";
		$.post(
				"ajax.php?mod=journals&code=simple_talk&id=$id",
				function(d){
					showDialog(handle_key, 'local', '报名成功，说说你对该游记有什么看法？', {"html":d}, 500);
					$('#topic_simple_close_btn').click(
						function() {
							location.reload();
						}
					);
					$('#topic_simple_share_btn').click(
						function () {
							var options = {
									response:function(){
										location.reload();
									},
									topic_type:$('#topic_simple_type').val()
								}
							if(!$('#topic_simple_content').val()){MessageBox('notice', '请输入评论内容');return false;}
							publishSimpleTopic($('#topic_simple_content').val(), 'event', $("#topic_simple_item_id").val(),options);
						}
					);
				}
		);
	}

	function store(t){
		var check_uid = $('#check_PublishBox_uid').val();
		var uid ='undefined'==typeof(check_uid)?'0':check_uid;	
		if(uid < 1){
			ShowLoginDialog();
			return false;
		}
		$.post("ajax.php?mod=journals&code=store&id=$id&type="+t,
				function(d){
			location.reload();
			}
		);
	}

	</script>
  </div>
	
    <!--右侧--begin-->
    <div class="mainSide">
	
	<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][event][middle_right_top]}-->
	<!--{eval SetADV('journals','middle_right_top');}-->
	<!--{/if}-->
	
    {template "topic_right_ajax.inc"}
	  <div class="side">
	    <ul class="event_r_nav">
	      <li>
	        <a href="index.php?mod=journals"><span>游记主页</span></a>
	      </li>
	      <li>
	        <a href="index.php?mod=journals&code=myjournals"><span>我的游记</span></a>
	      </li>
		  <li>
			<a href="index.php?mod=journals&code=followjournals"><span>我关注的人的游记</span></a>
		  </li>
	      <li>
	        <a href="index.php?mod=journals&code=pevent"><span>发起游记</span></a>
	      </li>
	      <li>
	        <a href="index.php?mod=journals&code=draft"><span>游记草稿箱</span></a>
	      </li>
	    </ul>
	  </div>
	<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][event][middle_right]}-->
	<!--{eval SetADV('journals','middle_right');}-->
	<!--{/if}-->
	</div>
	<!--右侧--end-->
  </div>

<!--{if $this->Config[ad_enable]}-->
<!--{eval SetADV('journals','footer');}-->
<!--{/if}-->
  
<!--{template "topic_footer"}-->